#ifndef CNRFREADER_HPP
#define CNRFREADER_HPP

// System includes
#include "librf24/RF24.h"

// Other includes
#include "CObservable.hpp"

class CCommand;
class CObserver;

class CNRFReader : public CObservable
{
public:
   /**
    * @brief Constructor
    * @param device Device name
    */
   CNRFReader(CObserver* pObserver);

   /**
    * @brief Starts server:
    *        Opens device and starts reading commands from it
    */
   void start();

   void sendCommand(CCommand cmd);

   bool isConnected();
   
   //void initSerialPort();
   
   ~CNRFReader();
protected:

private:
   pthread_mutex_t mLock;     // Serial port pointer should be synchronized.
   RF24 mRadio;
};

#endif // CNRFREADER_HPP